import Mock from 'mockjs';

const { mock } = Mock;

mock("/api/dict/types", "get", {
    code: 200,
    data: {
        total: 5,
        list: [
            {
                id: "1",
                typeName: "性别",
                typeCode: "gender",
                status: "1",
                remark: "性别字典",
                createdTime: "2023-01-01 10:00:00",
                createdBy: "admin",
                updatedTime: "2023-01-01 10:00:00",
                updatedBy: "admin"
            },
            {
                id: "2",
                typeName: "状态",
                typeCode: "status",
                status: "1",
                remark: "通用状态",
                createdTime: "2023-01-02 11:00:00",
                createdBy: "admin",
                updatedTime: "2023-01-02 11:00:00",
                updatedBy: "admin"
            },
            {
                id: "3",
                typeName: "是否",
                typeCode: "yes_no",
                status: "1",
                remark: "是否选项",
                createdTime: "2023-01-03 12:00:00",
                createdBy: "admin",
                updatedTime: "2023-01-03 12:00:00",
                updatedBy: "admin"
            },
            {
                id: "4",
                typeName: "用户类型",
                typeCode: "user_type",
                status: "1",
                remark: "用户分类",
                createdTime: "2023-01-04 13:00:00",
                createdBy: "admin",
                updatedTime: "2023-01-04 13:00:00",
                updatedBy: "admin"
            },
            {
                id: "5",
                typeName: "优先级",
                typeCode: "priority",
                status: "1",
                remark: "任务优先级",
                createdTime: "2023-01-05 14:00:00",
                createdBy: "admin",
                updatedTime: "2023-01-05 14:00:00",
                updatedBy: "admin"
            }
        ]
    }
});

// 添加字典类型
mock("/api/dict/types", "post", {
    code: 200,
    data: {
        id: Mock.Random.id(),
        message: "添加成功"
    }
});

// 更新字典类型
mock("/api/dict/types", "put", {
    code: 200,
    data: {
        message: "更新成功"
    }
});

// 删除字典类型
mock("/api/dict/types", "delete", {
    code: 200,
    data: {
        message: "删除成功"
    }
});